package streaming.kafka

import org.apache.spark.SparkConf
import org.apache.spark.streaming.{Seconds, StreamingContext}

/**
  * receiver方式对接kafka 0.8.2.1 or higher
  *
  * spark-submit --packages org.apache.spark:spark-streaming-kafka-0-8_2.11:2.4.0 ...
  */
object KafkaReceiverWordCount {

  def main(args: Array[String]): Unit = {
    val sc = new SparkConf().setMaster("local[*]").setAppName("KafkaReceiverWordCount")
    val ssc = new StreamingContext(sc,Seconds(5))

    // Kafka0.10.0 不再支持Receiver DStream
//    val kafkaStream = KafkaUtils.createStream(streamingContext,
//      [ZK quorum], [consumer group id], [per-topic number of Kafka partitions to consume])


  }
}
